<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改签到管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-checkin-edit" th:object="${eduCheckin}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">签到教师ID：</label>
                <div class="col-sm-8">
                    <input name="teacherId" th:field="*{teacherId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">课程ID：</label>
                <div class="col-sm-8">
                    <input name="courseId" th:field="*{courseId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">教室ID：</label>
                <div class="col-sm-8">
                    <input name="classroomId" th:field="*{classroomId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="starttime" th:value="${#dates.format(eduCheckin.starttime, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:ii" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="finishtime" th:value="${#dates.format(eduCheckin.finishtime, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:ii" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <select name="status" class="form-control m-b" th:with="type=${@dict.getType('edu_checkin_status')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "education/checkin";
        $("#form-checkin-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-checkin-edit').serialize());
            }
        }

        $("input[name='starttime']").datetimepicker({
            format: "yyyy-mm-dd HH:ii",
            minView: "0",
            autoclose: true
        });

        $("input[name='finishtime']").datetimepicker({
            format: "yyyy-mm-dd HH:ii",
            minView: "0",
            autoclose: true
        });
    </script>
</body>
</html>